package com.example.demo.entity;


import com.example.demo.core.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.io.Serializable;

/**
 * @author yujie
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@EntityListeners(AuditingEntityListener.class)
@Table(name = "user", uniqueConstraints = {@UniqueConstraint(columnNames = {"phone"})})
public class User extends BaseEntity implements Serializable {

    private String name;

    private String phone;

    private String password;

    public User(String name) {
        this.name = name;
    }

    public User() {

    }

    public User(Integer id, String name) {
        this.name = name;
        super.setId(id);
    }




}
